library(tidyverse)
library(readxl)
path = "Excel/800-899/832/832 Delete Characters Around Asterisks.xlsx"
input = read_excel(path, range = "A1:A10")
test = read_excel(path, range = "B1:B10") %>%
mutate(`Answer Expected` = replace_na(`Answer Expected`, ""))
result = input %>%
mutate(result = str_remove_all(String, "(?<=\\*).|.(?=\\*)|\\*"))
all.equal(test$`Answer Expected`, result$result, check.attributes = F)Excel BI - Excel Challenge 832
excel-challenges
excel-formulas
🔰 String Answer Expected Nostalgia Nosta Resilience Rile Eloquence oqnce Euphoria******** Euphori

Challenge Description
🔰 String Answer Expected Nostalgia Nosta Resilience Rile Eloquence oqnce Euphoria******** Euphori
Solutions
- Logic: Read the workbook ranges needed for the challenge; Derive the required intermediate columns.
- Strengths: The code maps the workbook rule into a compact, reproducible pipeline.
- Areas for Improvement: The solution assumes the workbook layout and selected ranges remain stable, so any structural change in the sheet would require small adjustments.
- Gem: The elegant part is how little code is needed once the correct intermediate representation is chosen.
import pandas as pd
import re
import numpy as np
path = "800-899/832/832 Delete Characters Around Asterisks.xlsx"
input = pd.read_excel(path, usecols="A", nrows=10)
test = pd.read_excel(path, usecols="B", nrows=10).fillna("")
input['Result'] = input['String'].str.replace(r'(?<=\*).|.(?=\*)|\*', '', regex=True)
print(input['Result'].equals(test['Answer Expected'])) # TrueThe Python version mirrors the same workbook logic with a concise, direct implementation.
Difficulty Level
Easy / Medium
The business rule is clear, though the workbook still needs a few transformation steps to reach the expected output.